package org.maxkey.portal.model;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 导航菜单
 *  Mr.shi
 */
@Entity
@Table(
        name = "MXKP_NAVIGATION",
        indexes = {
                @Index(name = "PATH",  columnList="PATH", unique = true)})
@ToString
@Getter
@Setter
public class Navigation implements Serializable {
    private static final long serialVersionUID =  7415787526169091091L;
    /**
     * 声明主键
     * 声明主键的自增策略
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "ID")
    @GenericGenerator(name = "ID", strategy = "org.maxkey.portal.core.db.MIdentityGenerator")
    @Column(name="ID")
    private Integer id;

    @Column(name="PATENT_ID")
    private Integer parentId;

    /**
     *  路径
     */
    @Column(length = 256,name="PATH")
    private String path;

    /**
     * 名称
     */
    @Column(length = 256,name="NAME")
    private String name;

    /**
     * 组件
     */
    @Column(length = 256,name="COMPONET")
    private String component;


    /**
     * 页面显示标题
     */
    @Column(length = 256,name="TITLE")
    private String title;

    /**
     * 外链 _blank
     */
    @Column(length = 20,name="TARGET")
    private String target;


    /**
     * 权限集合
     */
    @Column(length = 256 ,name="ROLE")
    private String role;

    /**
     *
     */
    @Column(length = 20,name="MODE")
    private String mode;

    /**
     * 图标
     */
    @Column(length = 20,name="ICON")
    private String icon;

    /**
     * 创建时间
     */
    @Column(name="CREATE_TIME")
    private Date create_time;

    /**
     * 更新时间
     */
    @Column(name="UPDATE_TIME")
    private Date updateTime;

    /**
     * 状态 1有效  0无效
     */
    @Column(length = 3,name="STATUS")
    private Integer status = 1;


    /**
     * 当前页面是否隐藏导航
     */
    @Column(length = 3,name="MENUHIDDEN")
    private Boolean menuHidden = false;

}
